package com.aaa.service.fpa.impl;

import com.aaa.dao.fpa.TFpaPlaneMapper;
import com.aaa.entity.MyPage;
import com.aaa.entity.TFpaPlane;
import com.aaa.service.fpa.TFpaPlaneService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * (TFpaPlane)表服务实现类
 *
 * @author yuyongli
 * @since 2022-10-25 15:46:56
 */
@Service
public class TFpaPlaneServiceImpl implements TFpaPlaneService {
   @Autowired
   private TFpaPlaneMapper tFpaPlaneMapper;

   @Override
   public PageInfo queryAll(MyPage myPage) {
      PageHelper.startPage(myPage.getPage(),myPage.getLimit());

      return new PageInfo(tFpaPlaneMapper.selectAllData());
   }

    @Override
    public boolean selectPlane(TFpaPlane plane) {
        List<TFpaPlane> select = tFpaPlaneMapper.select(plane);
        return select.size()==0;
    }

    @Override
    public boolean insertPlane(TFpaPlane plane) {

       return tFpaPlaneMapper.insert(plane)>0;
    }

    @Override
    public TFpaPlane queryByQyCode(TFpaPlane tFpaPlane) {

        TFpaPlane tFpaPlane1 = tFpaPlaneMapper.selectOne(tFpaPlane);

        return tFpaPlane1;
    }
}

